package ltd.rycloud.tms.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Date;
import java.sql.Timestamp;

/***
 * @author     ：RYCloud.ltd ZhangLongBiao
 * @date       ：Created in 2019/6/24 13:00
 * @description：
 * @modified By：
 * @version: $
 *山东如翼云计算科技有限公司  张龙彪  15169994844
 ***/
@Entity
public class User {
    private int id;
    private String username;
    private String password;
    private Date registrationdate;
    private Timestamp lastlogindate;
    private int type;
    private String email;
    private String title;
    private String telephone;
    private String lastpsd;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "password")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Basic
    @Column(name = "registrationdate")
    public Date getRegistrationdate() {
        return registrationdate;
    }

    public void setRegistrationdate(Date registrationdate) {
        this.registrationdate = registrationdate;
    }

    @Basic
    @Column(name = "lastlogindate")
    public Timestamp getLastlogindate() {
        return lastlogindate;
    }

    public void setLastlogindate(Timestamp lastlogindate) {
        this.lastlogindate = lastlogindate;
    }

    @Basic
    @Column(name = "type")
    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Basic
    @Column(name = "email")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "telephone")
    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    @Basic
    @Column(name = "lastpsd")
    public String getLastpsd() {
        return lastpsd;
    }

    public void setLastpsd(String lastpsd) {
        this.lastpsd = lastpsd;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (id != user.id) return false;
        if (type != user.type) return false;
        if (username != null ? !username.equals(user.username) : user.username != null) return false;
        if (password != null ? !password.equals(user.password) : user.password != null) return false;
        if (registrationdate != null ? !registrationdate.equals(user.registrationdate) : user.registrationdate != null)
            return false;
        if (lastlogindate != null ? !lastlogindate.equals(user.lastlogindate) : user.lastlogindate != null)
            return false;
        if (email != null ? !email.equals(user.email) : user.email != null) return false;
        if (title != null ? !title.equals(user.title) : user.title != null) return false;
        if (telephone != null ? !telephone.equals(user.telephone) : user.telephone != null) return false;
        if (lastpsd != null ? !lastpsd.equals(user.lastpsd) : user.lastpsd != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (username != null ? username.hashCode() : 0);
        result = 31 * result + (password != null ? password.hashCode() : 0);
        result = 31 * result + (registrationdate != null ? registrationdate.hashCode() : 0);
        result = 31 * result + (lastlogindate != null ? lastlogindate.hashCode() : 0);
        result = 31 * result + type;
        result = 31 * result + (email != null ? email.hashCode() : 0);
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (telephone != null ? telephone.hashCode() : 0);
        result = 31 * result + (lastpsd != null ? lastpsd.hashCode() : 0);
        return result;
    }
}
